package com.example.crowdfunding.mapper;

import com.example.crowdfunding.entity.Admin;
import com.example.crowdfunding.entity.AdminExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * The interface Admin mapper.
 */
public interface AdminMapper {

    /**
     * Count by example int.
     *
     * @param example the example
     * @return the int
     */
    int countByExample(AdminExample example);

    /**
     * Delete by example int.
     *
     * @param example the example
     * @return the int
     */
    int deleteByExample(AdminExample example);

    /**
     * Delete by primary key int.
     *
     * @param id the id
     * @return the int
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * Insert int.
     *
     * @param record the record
     * @return the int
     */
    int insert(Admin record);

    /**
     * Insert selective int.
     *
     * @param record the record
     * @return the int
     */
    int insertSelective(Admin record);

    /**
     * Select by example list.
     *
     * @param example the example
     * @return the list
     */
    List<Admin> selectByExample(AdminExample example);

    /**
     * Select by primary key admin.
     *
     * @param id the id
     * @return the admin
     */
    Admin selectByPrimaryKey(Integer id);

    /**
     * Update by example selective int.
     *
     * @param record  the record
     * @param example the example
     * @return the int
     */
    int updateByExampleSelective(@Param("record") Admin record, @Param("example") AdminExample example);

    /**
     * Update by example int.
     *
     * @param record  the record
     * @param example the example
     * @return the int
     */
    int updateByExample(@Param("record") Admin record, @Param("example") AdminExample example);

    /**
     * Update by primary key selective int.
     *
     * @param record the record
     * @return the int
     */
    int updateByPrimaryKeySelective(Admin record);

    /**
     * Update by primary key int.
     *
     * @param record the record
     * @return the int
     */
    int updateByPrimaryKey(Admin record);

    /**
     * Select admin by keyword list.
     *
     * @param keyword the keyword
     * @return the list
     */
    List<Admin> selectAdminByKeyword(String keyword);

    void delOldRelationship(Integer adminId);

    void insertNewRelationship(@Param("adminId") Integer adminId, @Param("roleIds") List<Integer> roleIds);

}